// config.rs
use serde::Deserialize;

#[derive(Deserialize, Debug)]
pub struct Config {
    pub server_address: String,
    pub database_path: String,
}

impl Config {
    pub fn from_file(file_path: &str) -> Result<Self, std::io::Error> {
        let config_string = std::fs::read_to_string(file_path)?;
        let config: Config = toml::from_str(&config_string)?;
        Ok(config)
    }
}
